package com.good.cms.admin.api;

import com.good.cms.admin.client.ContentClient;
import com.good.cms.admin.vo.Content;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @package: com.good.cms.admin.api
 * @description:
 * @author: cuiP
 * @date: 2018/1/8 16:37
 * @version: V1.0.0
 */
@RestController
public class ContentController {

    @Resource
    private ContentClient contentClient;

    @GetMapping("/api/contents")
    public ResponseEntity<List<Content>> list(){
        return ResponseEntity.ok(contentClient.findAll());
    }
}
